<template>
  <runtime-node :template="template" />
</template>

<script>
import RuntimeNode from './RuntimeNode.vue';

export default {
  name: 'RuntimeRoot',
  inject: {
    runtime: {
      default: null,
    },
  },
  provide() {
    return {
      runtime: {
        root: this,
        componentMap: this.runtime?.componentMap,
        placeholder: RuntimeNode,
      },
    };
  },
  components: { RuntimeNode },
  props: {
    template: {
      type: Object,
      required: true,
    },
    model: {
      type: Object,
      required: true,
    },
  },
};
</script>
